package com.dgut.sales.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dgut.sales.bean.Salesman;
import com.dgut.sales.dao.SalesmanDao;
import com.dgut.sales.dynamic.sql.bean.SalesmanSearch;

@Service
public class SalesmanService {
	
	@Autowired
	private SalesmanDao dao;
	
	public Salesman getSalesById(Integer id) {
		return dao.getSalesmanById(id);
	}
	
	public List<Salesman> getAllSalesman(){
		return dao.getAllSalesman();
	}
	
	public void addSalesman(Salesman salesman) {
		dao.addSalesman(salesman);
	}
	
	public void update(Salesman salesman) {
		dao.updateSalesman(salesman);
	}
	
	public void deleteSalesman(Integer id) {
		dao.deleteSalesman(id);
	}
	public List<Salesman> search(SalesmanSearch salesmanSearch){
		return dao.search(salesmanSearch);
	}
	public List<Map<String, Object>> searchSalesmanWithMoney(){
		return dao.SearchSalesmanWithMoney();
	}

}
